package com.sky.controller;



import com.sky.entity.CangKu;
import com.sky.result.Result;
import com.sky.service.CangKuService;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 仓库Controler
 */
@Controller
@RequestMapping("/cangku")
@Slf4j
public class CangkuController {

    @Resource
    private CangKuService cangKuService;




        @RequestMapping("/index")
        public String index(){
            System.out.println("------------------");
            return "cangKuList";
        }


        @RequestMapping("/list")
        @ResponseBody
        public Result list(CangKu cangKu){
            System.out.println(cangKu);
            final val list = cangKuService.getCangKuList(cangKu);
            System.out.println(list);
            return Result.success(list);
        }


        /**
         * 新增仓库
         * @param cangKu
         * @return
         */
        @RequestMapping("/add")
        @ResponseBody
        public Result add(@RequestBody CangKu cangKu){
        log.info("新增仓库信息:{}",cangKu);

        return null;
        }



}
